<?php

class daoFactory {
    private static $instance = null;
    private static $daoSet = array();

    public static function getInstance () {
        if (!self::$instance) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    public function getCategorysDao () {
        if (!isset(self::$daoSet['CategorysDao'])) {
            require_once 'modules/dao/Impl/categorysDao.php';
            self::$daoSet['CategorysDao'] = new CategorysDao();
        }
        return self::$daoSet['CategorysDao'];
    }

    public function getLinksDao () {
        if (!isset(self::$daoSet['LinksDao'])) {
            require_once 'modules/dao/Impl/linksDao.php';
            self::$daoSet['LinksDao'] = new LinksDao();
        }
        return self::$daoSet['LinksDao'];
    }
}
?>